<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class StockAllocationLog extends BaseModel
{
    use HasFactory;
    //调货记录
    protected $table = 'stock_allocation_log';
    // 允许批量操作的字段
    protected $fillable = [
        'id',
        'finish_product_id',
        'finish_order_id',
        'order_id',
        'finish_customer_name',
        'order_customer_name',
        'order_number',
        'finish_order_remark',
        'order_remark',
        'logistics_status',
        'created_at',
        'updated_at',
    ];

    public function scopeSearch($query,$params)
    {
        return $query;
    }
    public function order(){
        return $this->hasOne(Order::class,'id','order_id');
    }

    public function finish_order(){
        return $this->hasOne(Order::class,'id','finish_order_id');
    }
}
